clear all
cd ..

set scheme s2color

use "Data/Processed Data/ACSdata_bg_pc_reallocations30_wsize.dta" 
lpoly pc_original Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(15000) noscatter ci title("Original") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(2) size(small) symxsize(*.3) symysize(*.5)) note("") graphregion(color(white)) bgcolor(white) name(original)
lpoly pc_interstate Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(5000) noscatter ci title("Max Total Benefits") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(1)) note("") graphregion(color(white)) bgcolor(white) name(interstate)
lpoly pc_nonwhite Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(15000) noscatter ci title("Max People of Color") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(1)) note("") graphregion(color(white)) bgcolor(white) name(nonwhite)
lpoly pc_bottom1 Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(15000) noscatter ci title("Max Bottom Decile") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(1)) note("") graphregion(color(white)) bgcolor(white) name(bottom1)
lpoly pc_zip_nonwhiteShare Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(15000) noscatter ci title("Zips of Color") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(1)) note("") graphregion(color(white)) bgcolor(white) name(zip_nonwhiteShare)
lpoly pc_zip_bottom1Share Median_HH if Median_HH<150000, kernel(ep) bw(10000) pwidth(15000) noscatter ci title("Bottom Decile Zips") xtitle("Median Household Income") ytitle("Environmental Benefits ($) per Capita") legend(label(1 "95% CI") label(2 "Fitted Env Benefits") position(11) ring(0) col(1)) note("") graphregion(color(white)) bgcolor(white) name(zip_bottom1Share)

grc1leg2 original interstate nonwhite bottom1 zip_nonwhiteShare zip_bottom1Share, col(3) graphregion(color(white))

graph export "tables/env_ben_vs_income_reallocations_wsize.pdf", replace
graph export "tables/env_ben_vs_income_reallocations_wsize.eps", replace
